/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package consumo.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Carlos Taschetto
 */
@Entity
@Table(name = "contrato", catalog = "consumodb", schema = "")
@NamedQueries({
    @NamedQuery(name = "Contrato.findAll", query = "SELECT c FROM Contrato c"),
    @NamedQuery(name = "Contrato.findById", query = "SELECT c FROM Contrato c WHERE c.id = :id"),
    @NamedQuery(name = "Contrato.findByInicio", query = "SELECT c FROM Contrato c WHERE c.inicio = :inicio"),
    @NamedQuery(name = "Contrato.findByJanFp", query = "SELECT c FROM Contrato c WHERE c.janFp = :janFp"),
    @NamedQuery(name = "Contrato.findByJanP", query = "SELECT c FROM Contrato c WHERE c.janP = :janP"),
    @NamedQuery(name = "Contrato.findByFevFp", query = "SELECT c FROM Contrato c WHERE c.fevFp = :fevFp"),
    @NamedQuery(name = "Contrato.findByFevP", query = "SELECT c FROM Contrato c WHERE c.fevP = :fevP"),
    @NamedQuery(name = "Contrato.findByMarFp", query = "SELECT c FROM Contrato c WHERE c.marFp = :marFp"),
    @NamedQuery(name = "Contrato.findByMarP", query = "SELECT c FROM Contrato c WHERE c.marP = :marP"),
    @NamedQuery(name = "Contrato.findByAbrFp", query = "SELECT c FROM Contrato c WHERE c.abrFp = :abrFp"),
    @NamedQuery(name = "Contrato.findByAbrP", query = "SELECT c FROM Contrato c WHERE c.abrP = :abrP"),
    @NamedQuery(name = "Contrato.findByMaiFp", query = "SELECT c FROM Contrato c WHERE c.maiFp = :maiFp"),
    @NamedQuery(name = "Contrato.findByMaiP", query = "SELECT c FROM Contrato c WHERE c.maiP = :maiP"),
    @NamedQuery(name = "Contrato.findByJunFp", query = "SELECT c FROM Contrato c WHERE c.junFp = :junFp"),
    @NamedQuery(name = "Contrato.findByJunP", query = "SELECT c FROM Contrato c WHERE c.junP = :junP"),
    @NamedQuery(name = "Contrato.findByJulFp", query = "SELECT c FROM Contrato c WHERE c.julFp = :julFp"),
    @NamedQuery(name = "Contrato.findByJulP", query = "SELECT c FROM Contrato c WHERE c.julP = :julP"),
    @NamedQuery(name = "Contrato.findByAgoFp", query = "SELECT c FROM Contrato c WHERE c.agoFp = :agoFp"),
    @NamedQuery(name = "Contrato.findByAgoP", query = "SELECT c FROM Contrato c WHERE c.agoP = :agoP"),
    @NamedQuery(name = "Contrato.findBySetFp", query = "SELECT c FROM Contrato c WHERE c.setFp = :setFp"),
    @NamedQuery(name = "Contrato.findBySetP", query = "SELECT c FROM Contrato c WHERE c.setP = :setP"),
    @NamedQuery(name = "Contrato.findByOutFp", query = "SELECT c FROM Contrato c WHERE c.outFp = :outFp"),
    @NamedQuery(name = "Contrato.findByOutP", query = "SELECT c FROM Contrato c WHERE c.outP = :outP"),
    @NamedQuery(name = "Contrato.findByNovFp", query = "SELECT c FROM Contrato c WHERE c.novFp = :novFp"),
    @NamedQuery(name = "Contrato.findByNovP", query = "SELECT c FROM Contrato c WHERE c.novP = :novP"),
    @NamedQuery(name = "Contrato.findByDezFp", query = "SELECT c FROM Contrato c WHERE c.dezFp = :dezFp"),
    @NamedQuery(name = "Contrato.findByDezP", query = "SELECT c FROM Contrato c WHERE c.dezP = :dezP"),
    @NamedQuery(name = "Contrato.findByIcmsDemanda", query = "SELECT c FROM Contrato c WHERE c.icmsDemanda = :icmsDemanda")})
public class Contrato implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id", nullable = false)
    private Integer id;
    @Column(name = "inicio")
    @Temporal(TemporalType.DATE)
    private Date inicio;
    @Column(name = "jan_fp")
    private Integer janFp;
    @Column(name = "jan_p")
    private Integer janP;
    @Column(name = "fev_fp")
    private Integer fevFp;
    @Column(name = "fev_p")
    private Integer fevP;
    @Column(name = "mar_fp")
    private Integer marFp;
    @Column(name = "mar_p")
    private Integer marP;
    @Column(name = "abr_fp")
    private Integer abrFp;
    @Column(name = "abr_p")
    private Integer abrP;
    @Column(name = "mai_fp")
    private Integer maiFp;
    @Column(name = "mai_p")
    private Integer maiP;
    @Column(name = "jun_fp")
    private Integer junFp;
    @Column(name = "jun_p")
    private Integer junP;
    @Column(name = "jul_fp")
    private Integer julFp;
    @Column(name = "jul_p")
    private Integer julP;
    @Column(name = "ago_fp")
    private Integer agoFp;
    @Column(name = "ago_p")
    private Integer agoP;
    @Column(name = "set_fp")
    private Integer setFp;
    @Column(name = "set_p")
    private Integer setP;
    @Column(name = "out_fp")
    private Integer outFp;
    @Column(name = "out_p")
    private Integer outP;
    @Column(name = "nov_fp")
    private Integer novFp;
    @Column(name = "nov_p")
    private Integer novP;
    @Column(name = "dez_fp")
    private Integer dezFp;
    @Column(name = "dez_p")
    private Integer dezP;
    @Basic(optional = false)
    @Column(name = "icms_demanda", nullable = false)
    private boolean icmsDemanda;
    @JoinColumn(name = "tipo_uso", referencedColumnName = "id", nullable = false)
    @ManyToOne(optional = false)
    private TipoUso tipoUso;
    @JoinColumn(name = "tarifa", referencedColumnName = "id", nullable = false)
    @ManyToOne(optional = false)
    private Tarifa tarifa;
    @JoinColumn(name = "cliente", referencedColumnName = "id", nullable = false)
    @ManyToOne(optional = false)
    private Cliente cliente;

    public Contrato() {
    }

    public Contrato(Integer id) {
        this.id = id;
    }

    public Contrato(Integer id, boolean icmsDemanda) {
        this.id = id;
        this.icmsDemanda = icmsDemanda;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Date getInicio() {
        return inicio;
    }

    public void setInicio(Date inicio) {
        this.inicio = inicio;
    }

    public Integer getJanFp() {
        return janFp;
    }

    public void setJanFp(Integer janFp) {
        this.janFp = janFp;
    }

    public Integer getJanP() {
        return janP;
    }

    public void setJanP(Integer janP) {
        this.janP = janP;
    }

    public Integer getFevFp() {
        return fevFp;
    }

    public void setFevFp(Integer fevFp) {
        this.fevFp = fevFp;
    }

    public Integer getFevP() {
        return fevP;
    }

    public void setFevP(Integer fevP) {
        this.fevP = fevP;
    }

    public Integer getMarFp() {
        return marFp;
    }

    public void setMarFp(Integer marFp) {
        this.marFp = marFp;
    }

    public Integer getMarP() {
        return marP;
    }

    public void setMarP(Integer marP) {
        this.marP = marP;
    }

    public Integer getAbrFp() {
        return abrFp;
    }

    public void setAbrFp(Integer abrFp) {
        this.abrFp = abrFp;
    }

    public Integer getAbrP() {
        return abrP;
    }

    public void setAbrP(Integer abrP) {
        this.abrP = abrP;
    }

    public Integer getMaiFp() {
        return maiFp;
    }

    public void setMaiFp(Integer maiFp) {
        this.maiFp = maiFp;
    }

    public Integer getMaiP() {
        return maiP;
    }

    public void setMaiP(Integer maiP) {
        this.maiP = maiP;
    }

    public Integer getJunFp() {
        return junFp;
    }

    public void setJunFp(Integer junFp) {
        this.junFp = junFp;
    }

    public Integer getJunP() {
        return junP;
    }

    public void setJunP(Integer junP) {
        this.junP = junP;
    }

    public Integer getJulFp() {
        return julFp;
    }

    public void setJulFp(Integer julFp) {
        this.julFp = julFp;
    }

    public Integer getJulP() {
        return julP;
    }

    public void setJulP(Integer julP) {
        this.julP = julP;
    }

    public Integer getAgoFp() {
        return agoFp;
    }

    public void setAgoFp(Integer agoFp) {
        this.agoFp = agoFp;
    }

    public Integer getAgoP() {
        return agoP;
    }

    public void setAgoP(Integer agoP) {
        this.agoP = agoP;
    }

    public Integer getSetFp() {
        return setFp;
    }

    public void setSetFp(Integer setFp) {
        this.setFp = setFp;
    }

    public Integer getSetP() {
        return setP;
    }

    public void setSetP(Integer setP) {
        this.setP = setP;
    }

    public Integer getOutFp() {
        return outFp;
    }

    public void setOutFp(Integer outFp) {
        this.outFp = outFp;
    }

    public Integer getOutP() {
        return outP;
    }

    public void setOutP(Integer outP) {
        this.outP = outP;
    }

    public Integer getNovFp() {
        return novFp;
    }

    public void setNovFp(Integer novFp) {
        this.novFp = novFp;
    }

    public Integer getNovP() {
        return novP;
    }

    public void setNovP(Integer novP) {
        this.novP = novP;
    }

    public Integer getDezFp() {
        return dezFp;
    }

    public void setDezFp(Integer dezFp) {
        this.dezFp = dezFp;
    }

    public Integer getDezP() {
        return dezP;
    }

    public void setDezP(Integer dezP) {
        this.dezP = dezP;
    }

    public boolean getIcmsDemanda() {
        return icmsDemanda;
    }

    public void setIcmsDemanda(boolean icmsDemanda) {
        this.icmsDemanda = icmsDemanda;
    }

    public TipoUso getTipoUso() {
        return tipoUso;
    }

    public void setTipoUso(TipoUso tipoUso) {
        this.tipoUso = tipoUso;
    }

    public Tarifa getTarifa() {
        return tarifa;
    }

    public void setTarifa(Tarifa tarifa) {
        this.tarifa = tarifa;
    }

    public Cliente getCliente() {
        return cliente;
    }

    public void setCliente(Cliente cliente) {
        this.cliente = cliente;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Contrato)) {
            return false;
        }
        Contrato other = (Contrato) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "consumo.persistence.Contrato[id=" + id + "]";
    }

}
